import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/sys-admin/index',
    children: [
      // ====================== 以下是【首页】的路由配置 ======================
      {
        path: '/sys-admin/index',
        component: () => import('../views/sys-admin/SystemAdminIndex.vue')
      },
      // ====================== 以下是【商品管理】的路由配置 ======================
      {
        path: '/sys-admin/product/album/add-new',
        component: () => import('../views/sys-admin/product/AlbumAddNewView.vue')
      },
      {
        path: '/sys-admin/product/album',
        component: () => import('../views/sys-admin/product/AlbumListView.vue')
      },
      {
        path: '/sys-admin/product/album/picture-list',
        component: () =>import('../views/sys-admin/product/AlbumPictureListView')
      },
      {
        path: '/sys-admin/product/category/addNew',
        component: () => import('../views/sys-admin/product/CategoryAddNew.vue')
      },
      {
        path: '/sys-admin/product/category',
        component: () => import('../views/sys-admin/product/CategoryListView.vue')
      },
      {
        path: '/sys-admin/product/order',
        component: () => import('../views/sys-admin/product/OrderListItemView.vue')
      },
      {
        path: '/sys-admin/product/login',
        component: () => import('../views/sys-admin/product/UserListView.vue')
      },
      {
        path: '/sys-admin/product/reg',
        component: () => import('../views/sys-admin/product/UserAddNewView.vue')
      },
      {
        path: '/sys-admin/product/brand/add-new',
        component: () => import('../views/sys-admin/product/BrandAddNewView.vue')
      },
      {
        path: '/sys-admin/product/brand',
        component: () => import('../views/sys-admin/product/BrandListView.vue')
      },
      {
        path: '/sys-admin/product/attribute',
        component: () => import('../views/sys-admin/product/AttributeListView')
      },
      {
        path: '/sys-admin/product/attribute/add-new',
        component: () => import('../views/sys-admin/product/AttributeAddNewView')
      },
      {
        path: '/sys-admin/product/attribute-template/add-new',
        component: () => import('../views/sys-admin/product/AttributesTemplateAddNewView')
      },
      {
        path: '/sys-admin/product/attribute-template',
        component: () => import('../views/sys-admin/product/AttributesTemplateListView')
      },
      {
        path: '/sys-admin/product/spu-management',
        component: () => import('../views/sys-admin/product/SpuManagement.vue')
      },
      {
        path: '/sys-admin/product/spu-management/sku-list',
        component: () => import('../views/sys-admin/product/SkuListView.vue')
      },
      {
        path: '/sys-admin/product/spu-management/spu/add-new1',
        component: () => import('../views/sys-admin/product/SpuAddNewView1.vue')
      },
      {
        path: '/sys-admin/product/spu-management/spu/add-new2',
        component: () => import('../views/sys-admin/product/SpuAddNewView2.vue')
      },
      {
        path: '/sys-admin/product/spu-management/spu/add-new3',
        component: () => import('../views/sys-admin/product/SpuAddNewView3.vue')
      },
      {
        path: '/sys-admin/product/spu-management/spu/add-new4',
        component: () => import('../views/sys-admin/product/SpuAddNewView4.vue')
      },
      // ====================== 以下是【权限管理】的路由配置 ======================
      {
        path: '/sys-admin/permission/admin',
        component: () => import('../views/sys-admin/permission/AdminListView.vue')
      },
      {
        path: '/sys-admin/permission/admin/add-new',
        component: () => import('../views/sys-admin/permission/AdminAddNewView.vue')
      },
      // ====================== 以下是【宠物领养管理】的路由配置 ======================
      {
        path: '/sys-admin/pet-management',
        component: () => import('../views/sys-admin/pet/PetListView')
      },
      {
        path: '/sys-admin/pet-management/add-new',
        component: () => import('../views/sys-admin/pet/PetAddNewView')
      },
      {
        path: '/sys-admin/pet-management/adopt',
        component: () => import('../views/sys-admin/pet/PetAdoptListView')
      },
      {
        path: '/sys-admin/pet-management/picture',
        component: () => import('../views/sys-admin/pet/PetPictureListView')
      },
      {
        path: '/sys-admin/pet-management/adopt/record',
        component: () => import('../views/sys-admin/pet/AdoptRecordView')
      },
    ]
  },
  {
    path: '/about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
